﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.Xml;
using PloobsEngine.Utils;
using PloobsEngine.Modelo;
using PloobsEngine.SceneControl;

namespace PloobsEngine.Physics.Bepu
{   
    /// <summary>
    /// Lots of physicObjects together, DONT HAVE ANY INDIVIDUAL PROPERTY
    /// NEED TO ACCESS EACH OBJECT INDIVIDUALY
    /// YOU SHOULD NOT USE THIS CLASS !!! JUST IN EXCEPTIONAL CASES
    /// </summary>
    public class AgregatedPhysicObject : IPhysicObject
    {
        List<IPhysicObject> physicsObjects = new List<IPhysicObject>();

        public List<IPhysicObject> PhysicsObjects
        {
            get { return physicsObjects; }
            set { physicsObjects = value; }
        }

        #region IPhysicObject Members

        Vector3 IPhysicObject.Position
        {
            get
            {
                return Vector3.Zero;
            }
            set
            {
                
            }
        }

        Vector3 IPhysicObject.Scale
        {
            get
            {
                return Vector3.Zero;
            }
            set
            {
                
            }
        }

        Matrix IPhysicObject.Rotation
        {
            get
            {
                return Matrix.Identity;
            }
            set
            {
                
            }
        }

        Vector3 IPhysicObject.FaceVector
        {
            get { return Vector3.Zero; }
        }

        Matrix IPhysicObject.WorldMatrix
        {
            get { return Matrix.Identity; }
        }

        Vector3 IPhysicObject.Velocity
        {
            get
            {
                return Vector3.Zero;
            }
            set
            {                
            }
        }

        void IPhysicObject.Serialize(XmlTextWriter textWriter)
        {
            
        }

        void IPhysicObject.DeSerialize(XmlNode node, EngineStuff engine, IModelo model, Vector3 position, Matrix rotation)
        {
            
        }

        bool IPhysicObject.isMotionLess
        {
            get
            {
                return true;
            }
            set
            {                
            }
        }

        IObject owner;
        PloobsEngine.SceneControl.IObject IPhysicObject.ObjectOwner
        {
            get
            {
                return owner;
            }
            set
            {
                this.owner = value;
            }
        }

        PhysicObjectTypes IPhysicObject.PhysicObjectTypes
        {
            get { return PhysicObjectTypes.GHOST; }
        }

        void IPhysicObject.Enable()
        {
        }

        void IPhysicObject.Disable()
        {         
        }

        void IPhysicObject.ApplyImpulse(Vector3 force)
        {         
        }

        void IPhysicObject.ApplyTorque(Vector3 force)
        {         
        }

        BoundingBox IPhysicObject.BoundingBox
        {
            get { return new BoundingBox(); }
        }

        #endregion
    }
}
